import { $Http } from '@/config/service/http';

// 档案高级查询
export enum Api {
  advancedQueryArchivesTypeTree = '/dms/advancedQuery/archivesTypeTree', // 查询档案类型目录树
  advancedQueryFindPageByTypeId = '/dms/advancedQuery/findPageByTypeId', // 档案类型分页查询
  advancedQueryPage = '/dms/advancedQuery/page', // 条件分页查询
  typeTree = '/dms/archives/type/tree', // 查询档案类型树
  subjectListSimple = '/system/subject/listSimple', // 用户列表-简单
  orgTreeData = '/system/org/treeData', // 机构树
  folderTree = '/dms/archives/folder/tree', // 查询档案目录树
  advancedQueryDownload = '/dms/advancedQuery/download', // 下载
  advancedQueryPreview = '/dms/advancedQuery/preview', // 预览
  advancedQueryBatchDownload = '/dms/advancedQuery/batchDownload', // 批量下载
  boxPage = '/dms/archives/box/transferPage', // 分页查询档案盒
  advancedQueryUpdateStatus = '/dms/advancedQuery/updateStatus', // 档案高级查询状态变更
  normalRecordPage = '/dms/archivesNormalQuery/page', // 普通用户分页查询
  normalPreview = '/dms/archivesNormalQuery/preview', // 普通用户预览
  normalDownload = '/dms/archivesNormalQuery/download', // 普通用户下载
  normalBatchDownload = '/dms/archivesNormalQuery/batchDownload' // 普通用户批量下载
}

/**
 * 查询档案类型目录树
 * @param params
 * name 名称
 */
export const advancedQueryArchivesTypeTree = (params) => {
  return $Http.api(Api.advancedQueryArchivesTypeTree, params, 'post');
};

/**
 * 下载
 * @param params
 * id
 */
export const advancedQueryDownload = (id, params) => {
  return $Http.api(Api.advancedQueryDownload + '/' + id, params, 'get');
};

/**
 * 预览
 * @param params
 * id
 */
export const advancedQueryPreview = (params) => {
  return $Http.api(Api.advancedQueryPreview, params, 'post');
};

/**
 * 批量下载
 * @param params
 * ids	ids
 */
export const advancedQueryBatchDownload = (params) => {
  return $Http.api(Api.advancedQueryBatchDownload, params, 'post');
};

export const normalPreview = (params) => {
  return $Http.api(Api.normalPreview, params, 'post');
};

export const normalDownload = (id, params) => {
  return $Http.api(Api.normalDownload + '/' + id, params, 'get');
};

export const normalBatchDownload = (params) => {
  return $Http.api(Api.normalBatchDownload, params, 'post');
};

export const advancedQueryUpdateStatus = (params) => {
  return $Http.api(Api.advancedQueryUpdateStatus, params, 'post');
};
